package com.probiz.estore.solrsearch.service;

import java.util.List;

import org.apache.solr.client.solrj.SolrServerException;

import com.probiz.estore.core.search.SearchCriteria;
import com.probiz.estore.solrsearch.model.IndexEntity;
import com.probiz.estore.solrsearch.model.SolrSearchCriteria;

public interface SolrSearchService {
	
	/**
	 * 重建索引
	 * @return
	 */
	public int buildFullIndex();
	/**
	 * 增量索引
	 * @return
	 */
	public int buildDeltaIndex();
	/**
	 * 删除索引
	 * @param pk
	 * @return
	 */
	public void deleteIndex(String pk);
	
	/**
	 * 引发重建索引事件，暂时未用到，前后台分离的时候才用到。
	 */
	public void fireRebuildFullIndex();
	
	/**
	 * 搜索索引
	 * @param solrSearchCriteria
	 * @param searchCriteria
	 * @return
	 */
	public List<IndexEntity> searchByCriteria(SolrSearchCriteria solrSearchCriteria,SearchCriteria searchCriteria) throws SolrServerException;
	
	public List<IndexEntity> searchByCriteriaForController(SolrSearchCriteria solrSearchCriteria,SearchCriteria searchCriteria) throws SolrServerException;
}